

from 银行取款系统简易版.admin import Admin
from 银行取款系统简易版.atm import ATM
import time

def main():
    view = Admin()

    view.adminView()
    if view.adminOption() == 0:
        atm = ATM()
        while True:
            view.userView()

            option = input("请输入您的操作:")
            if option == "t":
                if view.adminOption() == 0:
                    return opt(view, atm)
            else:
                atm.atmAction(option)
            time.sleep(1)

def opt(view, atm):
    view.adminView()
    if view.adminOption() == 0:
        while True:
            view.userView()

            option = input("请输入您的操作:")
            if option == "t":
                if view.adminOption() == 0:
                    return opt(view, atm)
            else:
                atm.atmAction(option)
            time.sleep(1)



if __name__ == '__main__':
    main()